We were adding the border gadget size and the label widget size in any
case, but when calculating the width, we want the maximum of those two,
not the sum.
https://bugzilla.gnome.org/show_bug.cgi?id=760482
frame = GTK_FRAME (widget);
priv = frame->priv;
+ gtk_css_gadget_get_preferred_size (priv->border_gadget,
+ orientation,
+ for_size,
+ &child_min,
+ &child_nat,
+ NULL, NULL);
+
+ *minimum = child_min;
+ *natural = child_nat;
+
if (priv->label_widget && gtk_widget_get_visible (priv->label_widget))
{
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
gtk_widget_get_preferred_width (priv->label_widget, &child_min, &child_nat);
- *minimum = child_min;
- *natural = child_nat;
+ *minimum = MAX (child_min, *minimum);
+ *natural = MAX (child_nat, *natural);
}
else
{
else
gtk_widget_get_preferred_height (priv->label_widget, &child_min, &child_nat);
- *minimum = child_min;
- *natural = child_nat;
+ *minimum += child_min;
+ *natural += child_nat;
}
}
- else
- {
- *minimum = 0;
- *natural = 0;
- }
-
- gtk_css_gadget_get_preferred_size (priv->border_gadget,
- orientation,
- for_size,
- &child_min,
- &child_nat,
- NULL, NULL);
-
- *minimum += child_min;
- *natural += child_nat;
}
static void